<template>
    <div class="content">
        <div class="content-div">

            <div class="content-div-left">
                <div class="content-div-left-header-about">关于我们</div>
                <div class="content-div-left-item" @click="check_nav_class('companyId')">
                    公司简介
                    <img src="@/static/engineering5188/company/nav-left.png" alt=""/>
                </div>
                <div class="content-div-left-item"  @click="check_nav_class('certailId')">
                    工商资质
                    <img src="@/static/engineering5188/company/nav-left.png" alt=""/>
                </div>
                <div class="content-div-left-item"   @click="check_nav_class('honerId')">
                    企业荣誉
                    <img src="@/static/engineering5188/company/nav-left.png" alt=""/>
                </div>
            </div>

            <div class="content-div-right">
                <div class="content-div-product">

                    <div class="content-div-title" id="companyId"> 
                        <div class="shuxing"></div>
                        <div>公司简介</div>
                    </div>

                    <div class="introductionClass">{{ detailData.company_introduction }}</div>

                    <div class="content-div-title m-t-40" id="certailId"> 
                        <div class="shuxing"></div>
                        <div>工商资质</div>
                    </div>
                    <div class="licenseContent">
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">企业名称：</div>
                            <div>{{ detailData.company_name }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">注册号：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.no:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">企业类型：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.type:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">法人代表：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.representative:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">成立时间：</div>
                            <div>{{ detailData.register_time }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">营业期限：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.business_term:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">经营状态：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.status:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">登记机关：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.authority:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">核准日期：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.approval:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">注册资本：</div>
                            <div>{{ detailData.registered_capital }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">注册地址：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.address:'' }}</div>
                        </div>
                        <div class="licenseContent-item">
                            <div class="licenseContent-item-label">经营范围：</div>
                            <div>{{ detailData.gongshang_info?detailData.gongshang_info.business_scope:'' }}</div>
                        </div>
                    </div>

                    <div class="content-div-title m-t-40" id="honerId"> 
                        <div class="shuxing"></div>
                        <div>企业荣誉</div>
                    </div>

                    <div class="honor-div">

                        <div class="honor-div-item"  v-for="(item,index) in detailData.enterprise_honor_certificate" :key="index">
                            <div class="honor-div-img">
                                <img :src="item.file_path" alt=""/>
                            </div>
                            <div class="honor-div-item-text">{{ item.title }}</div>
                        </div>
                    

                    </div>
                </div>

                
            </div>

        </div>
    </div>
</template>

<script>
import { mapState } from "vuex";
export default {
    computed: {
        ...mapState([
            "userInfo",
        ]),
    },
    data() {
        return {
            detailData:{},
            productList:[],
            gongshang_info:{},
        }
    },
    created(){
        this.getDetail();
        this.getProductList();
    },
    mounted() {
        this.$nextTick(() => {
            this.check_nav_class(this.$route.query.reload); 
        })
    },
    methods: {
        check_nav_class(item) {
            const categoryElement = document.getElementById( item);
          if (categoryElement) {
            categoryElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
          }
        },
        getDetail(){
            this.$httpApi("/api/getShopDetail", {
                shop_id: this.$route.query.shop_id
            }, "get").then(res =>{
                this.detailData = res.data;
                // if(this.detailData.gongshang_info){
                //     this.gongshang_info = JSON.parse(this.detailData.gongshang_info);
                // }
            })
        },
        getProductList(){
            this.$httpApi("/api/getProductList", {
                shop_id: this.$route.query.shop_id,
                page:1,
                limit:12
            }, "get").then(res =>{
                res.data.list.forEach(element => {
                    element.imageList = element.image.split(",");
                });
                this.productList = res.data.list;
            })
        }
    },
}
</script>

<style scoped lang="less">
.content{
    padding-top: 20px;
    background: #F6F6F6;
    
}
.content-div{
   width: 1200px;
   margin: 0 auto;
   display: flex; 
   padding-bottom: 20px;
}
.content-div-left{
    width: 188px;
    flex-basis: 228px;
    flex-grow: 0;      /* 禁止放大 */
    flex-shrink: 0;    /* 禁止缩小 */
    background-color: #FFFFFF;
    margin-right: 20px;
    

    .content-div-left-header-about{
        // background: #000000;
        height: 48px;
        line-height: 48px;
        font-weight: 500;
        font-size: 18px;
        color: #333333;
        border-bottom: 1px solid #E6E6E6;
        margin-left: 24px;
        margin-right: 24px;
    }
    .content-div-left-item{
        height: 48px;
        line-height: 48px;
        margin-left: 20px;
        margin-right: 20px;
        font-weight: 500;
        font-size: 14px;
        color: #333333;
        border-bottom: 1px solid #E6E6E6;
        padding-left: 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        img{
            width: 16px;
            height: 12px;
            margin-right: 24px;
        }
    }
}

.content-div-right{
    width: 100%;

    .content-div-right-header{
        height: 48px;
        background-color: #FFFFFF;
        font-weight: 500;
        font-size: 16px;
        color: #333333;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 24px;
        padding-right: 20px;
    }
    .content-div-right-tips{
        font-weight: 400;
        font-size: 14px;
        color: #999999;
    }
}

.content-div-product{
    margin-top: 10px;
    background-color: #FFFFFF;
    padding: 30px;
    padding-top: 34px;

    .content-div-product-item{
        width: 213px;
        height: 196px;
        border: 1px solid #E5E5E5;
        margin-right: 20px;
        margin-top: 20px;

        img{
            width: 100%;
            height: 130px;
        }

        .content-div-product-item-text{
            font-weight: 400;
            font-size: 14px;
            color: #000000;
            line-height: 22px;
            padding: 12px;
        }

    }
}

.company-profile{
    background-color: #fff;
    padding-top: 50px;
    padding-bottom: 62px;

    .company-profile-name{
        font-weight: 500;
        font-size: 36px;
        color: #0A0A0A;
        text-align: center;
    }
    .company-profile-tips{
        font-weight: 400;
        font-size: 16px;
        color: #999999;
        text-align: center;
        margin-top: 8px;
    }

    .company-profile-content{
        width: 1200px;
        margin: 0 auto;
        margin-top: 40px;
        display: flex;
        flex-direction: row;
        img{
            width: 468px;
            height: 343px;
            margin-right: 40px;
        }
        .company-profile-content-txt{
            font-weight: 400;
            font-size: 14px;
            color: #000000;
            line-height: 32px;
            text-align: left;
        }

        .company-profile-btn{
            width: 136px;
            height: 40px;
            border-radius: 24px 24px 24px 24px;
            border: 1px solid #333333;
            font-weight: normal;
            font-size: 14px;
            color: #333333;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 27px;
            img{
                width: 23px;
                height: 15px;
                margin-left: 10px;
                margin-right: 0px;
            }
        }
    }
}

.newProductClass{
    padding-top: 40px;
    padding-bottom: 62px;

    .company-profile-name{
        font-weight: 500;
        font-size: 36px;
        color: #0A0A0A;
        text-align: center;
    }
    .company-profile-tips{
        font-weight: 400;
        font-size: 16px;
        color: #999999;
        text-align: center;
        margin-top: 8px;
    }

    .newProductClass-content{
        width: 1200px;
        margin: 0 auto;
        display: flex;
        position: relative;

        .content-div-product-item{
            width: 224px;
            height: 202px;
            border: 1px solid #E5E5E5;
            margin-right: 20px;
            margin-top: 20px;

            img{
                width: 100%;
                height: 136px;
            }

            .content-div-product-item-text{
                font-weight: 400;
                font-size: 14px;
                color: #000000;
                line-height: 22px;
                padding: 12px;
            }

        }
        .arrowIcon{
            width: 40px;
            height: 40px;
        }
        .arrowIconClass{
            position: absolute;
            top: 78px;
            left: -40px;
        }
        .arrowIconClassRight{
            position: absolute;
            top: 78px;
            right: -40px;
        }
    }
}
.shuxing{
    width: 5px;
    height: 16px;
    background: #333333;
    border-radius: 6px 6px 6px 6px;
    margin-right: 12px;
}
.content-div-title{
    display: flex;
    font-weight: 600;
    font-size: 20px;
    color: #000000;
    line-height: 40px;
    align-items: center
}
.introductionClass{
    font-weight: 400;
    font-size: 14px;
    color: #333333;
    line-height: 32px;
    text-indent:28px;
    margin-top: 18px;
}
.m-t-40{
    margin-top: 40px;
}
.licenseContent{
    margin-top: 16px;
    background: #FAFBFC;
    border: 1px solid #EBEEF5;
    .licenseContent-item{
        margin-left: 34px;
        margin-right: 34px;
        height: 39px;
        border-bottom: 1px dashed #D8D8D8;
        display: flex;
        align-items: center;

        .licenseContent-item-label{
            font-weight: 500;
            font-size: 14px;
            color: #333333;
            text-align: right;
            width: 120px;
            margin-right: 12px;
        }
    }
}

.honor-div{
    display: flex;

    .honor-div-item{
        margin-top: 16px;

        width: 211px;
        height: 198px;
        background: #FFFFFF;
        box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.16);
        border-radius: 0px 0px 0px 0px;
        margin-right: 16px;
        .honor-div-img{
            margin-left: 16px;
            margin-right: 16px;
            padding-top: 16px;
            padding-bottom: 15px;
            border-bottom:  1px solid #D1D1D1;;
        }

        img{
            width: 179px;
            height: 123px;
        }
    }

    .honor-div-item-text{
        font-weight: 400;
        font-size: 14px;
        color: #333333;
        line-height: 20px;
        text-align: center;
        margin-top: 10px;
    }
}
</style>